package com.redhipps.hips.client.model;

import com.redhipps.hips.client.io.SerializedModel;

@Deprecated
public class DoctorConstraints {

  public static SerializedModel create(SerializedModel doc, SerializedModel schedule) {
    return create(doc, schedule.key());
  }

  public static SerializedModel create(SerializedModel doc, Key scheduleKey) {
    SerializedModel constraint = SerializedModel.createNewModel("DoctorConstraint");
    constraint.setProperty("doctor", doc.key());
    constraint.setProperty("schedule", scheduleKey);
    constraint.setProperty("min_shifts", doc.intProperty("min_shifts"));
    constraint.setProperty("max_shifts", doc.intProperty("max_shifts"));
    constraint.setProperty("max_night_shifts", doc.intProperty("max_night_shifts"));
    constraint.setProperty("max_consecutive_days", doc.intProperty("max_consecutive_days"));
    return constraint;
  }

  private DoctorConstraints() {}
}
